/**      
 * @file		SimpleLinkList.cpp
 * @description		This sample demonstrates how to construct
 *			a Link List Node, to point to the first node
 *			Once we have access to the first node we can
 *			access all other nodes.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */

#include <iostream> // NULL is defined in this library
#include "SimpleLinkList.h"
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {

	// The head is not a Node
	// it is a pointer to the first node
	// if there are no nodes in the list
	// we initialize head to NULL which is 0
	NodePtr head = NULL;

	NodePtr aNode = new Node;
	aNode->data = "Nissan 350z";
	aNode->next = NULL;

	head = aNode; // head points to the first node

	cout << "The data in the first element is " << head->data << endl;

	NodePtr aNode2 = new Node;
	aNode2->data = "Porsche 911";
	aNode2->next = NULL;

	// insert the Porsche node into the list
	head->next = aNode2;

	cout << "Outputting the nodes\n";
	for(NodePtr cur = head; cur != NULL; cur = cur->next) {
		cout << cur->data << endl;
	}

	// This list is known as a singly link list because we can
	// only move in one direction.

	return 0;
}
